!(function(J) {
    J.$ = {};
    J.$.wn = J.P.extend({
        pb: [J.ga],
        j: {
            callback: "cbk",
            type: "json",
            charset: "utf-8"
        },
        o: function(a, b) {
            J.e.wa(this, b);
            this.url = a;
            this.send(a)
        },
        send: function(a) {
            var b = J.a.create("script");
            b.type = "text/javascript";
            b.charset = this.j.charset;
            var c = this;
            J.f.vc ? b.onreadystatechange = function() {
                "loaded" !== this.readyState && "complete" !== this.readyState || c.k("complete")
            }: (b.onload = function() {
                c.k("complete")
            },
                b.onerror = function() {
                    c.k("error", {
                        status: 0,
                        info: "service error",
                        url: a
                    })
                });
            b.src = a;
            document.getElementsByTagName("head")[0].appendChild(b)
        }
    });
    J.$.ia = J.$.wn.extend({
        FC: function() {
            if (J.e.bx) return J.e.$m.push(this),
                !0
        },
        pG: function() {
            this.k("error", {
                info: "TIME_OUT_A"
            })
        },
        send: function(a) {
            function b() {
                window[c] = null;
                try {
                    delete window[c]
                } catch(a) {}
                d.onerror = null;
                d.parentNode && d.parentNode.removeChild(d)
            }
            if (!this.j.jk || !this.FC()) {
                a = encodeURI(a);
                var c = this.j.fun;
                if (!c || window[c]) c = J.e.OD("jsonp_", 6) + "_";
                var d = document.createElement("script");
                d.type = "text/javascript";
                d.charset = "utf-8";
                d.async = !0;
                var f = this;
                J.f.vc || (d.onerror = function() {
                    b();
                    f.k("error", {
                        info: "REQUEST_FAILED",
                        url: a
                    })
                });
                window[c] = function(a) {
                    b();
                    3E4 === a.errcode ? (J.e.bx = !0, J.La.load("AMap.AntiCrabFrame",
                        function() {
                            J.e.jk || (J.e.jk = new J.Xx);
                            J.e.$m.push(f);
                            J.e.jk.open(f.j.Px, a.data.host, f.sq)
                        })) : (a instanceof Array && (a = {
                        data: a
                    }), f.k("complete", a))
                };
                var g = "?"; - 1 !== a.indexOf("?") && (g = "&");
                g = a + g + this.j.callback + "=" + c; - 1 !== a.indexOf(J.m.Gb + "/v3") && (g += "&platform=JS&logversion=2.0&sdkversion=" + J.m.St, g += "&appname=" + J.m.jC);
                var h = this.j.Vh;
                if (h) {
                    var k = [],
                        l;
                    for (l in h) h.hasOwnProperty(l) && (k.push(l + "=" + h[l]), g += "&" + l + "=" + encodeURIComponent(h[l]));
                    f.sq = k.join("&")
                }
                d.src = g;
                J.$.ia.ts || (J.$.ia.ts = document.getElementsByTagName("head")[0]);
                J.$.ia.ts.appendChild(d)
            }
        }
    });
    window.AMap.Http = {};
    window.AMap.Http.JSONP = J.$.ia;
    J.$.XMLHttpRequest = J.$.wn.extend({
        send: function(a) {
            var b = this.vH = new XMLHttpRequest,
                c = this;
            b.onreadystatechange = function() {
                4 === b.readyState && 200 === b.status ? c.k("complete", {
                    url: a,
                    data: b.responseText
                }) : 404 === b.status && (b.abort(), c.k("error", {
                    url: a,
                    data: "404"
                }))
            };
            b.open("GET", a);
            b.send()
        },
        abort: function() {
            this.vH.abort()
        }
    });
})(J);